using System;
using System.IO;
using System.Text;
using System.Web;

namespace OpenWaves.ActivityFeed.Web.Handler
{
    internal class HttpRequestStub : HttpRequestBase, IDisposable
    {
        public HttpRequestStub(string httpMethod, Uri url, Stream inputStream)
        {
            this.httpMethod = httpMethod;
            this.inputStream = inputStream;
            this.url = url;
        }

        private readonly string httpMethod;
        public override string HttpMethod
        {
            get { return this.httpMethod; }
        }

        private readonly Stream inputStream;
        public override Stream InputStream
        {
            get { return this.inputStream; }
        }

        private Uri url;
        public override Uri Url
        {
            get { return this.url; }
        }

        public override Encoding ContentEncoding { get; set; }

        public override string ContentType { get; set; }


        protected virtual void Dispose(bool disposing)
        {
            if (disposing)
                this.inputStream.Dispose();
        }

        public void Dispose()
        {
            this.Dispose(true);
            GC.SuppressFinalize(this);
        }

    }
}